<template>
  <div id="box">
      <div class="topbar">
            <div class="iconfont" @click="fun()">
              <van-icon name="arrow-left"/>
            </div>
            <p>充值咖啡钱包</p>
            <span @click="pow()">更多优惠</span>
      </div>
      <div class="money">
        <div class="left"><span>￥</span>35</div>
        <div class="right">
            全国通用券
            <div>
              <span>-</span>
            <i>0</i>
              <span class="add">+</span>
            </div>
          </div>
      </div>
      <div class="money">
        <div class="left"><span>￥</span>32</div>
        <div class="right">
            全国通用券
            <div>
              <span>-</span>
            <i>0</i>
              <span class="add">+</span>
            </div>
          </div>
      </div>
      <div class="money">
        <div class="left"><span>￥</span>29</div>
        <div class="right">
            全国通用券
            <div>
              <span>-</span>
            <i>0</i>
              <span class="add">+</span>
            </div>
          </div>
      </div>
      <div>
        <van-submit-bar :price="0.0" button-text="提交订单" @submit="onSubmit" />
      </div>
      <h1 v-for="(v,i) in this.$store.state.mym.arr" :key="i">{{v.coffee[0].coffee_id}}</h1>
  </div>
</template>

<script>
export default {
      mounted() {
  //   //使用vuex发送异步请求---->dispatch触发actions发送异步
    //  this.$store.dispatch("dataper",{url:"http://81.68.226.70:8050/coffee/"});
    this.$store.dispatch("dataper",{url:"http://81.68.226.70:8050/user/logout/"});
    // this.$store.dispatch("dataper",{url:"http://81.68.226.70:8050/user/code/?phone=15664862159"});
  },
  methods: {
        fun(){
            this.$router.go(-1)
        },
        pow(){
          this.$router.push("/power")
        }
    }
}
</script>

<style scoped>
#box{
    padding:0 0.12rem;
    box-sizing: border-box;
    background:#f5f5f5;
}
.topbar{
    height: 0.9rem;
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.topbar .iconfont{
    font-size:0.3rem;
}
.topbar p{
    font-size:0.2rem ;
}
.topbar span{
    margin-top: 0.05rem;
}
.money{
  display: flex;
  height: 0.9rem;
  margin-bottom: 0.1rem;
}
.money .left{
  width: 1.05rem;
  text-align: center;
  font-size: 0.3rem;
  line-height: 0.7rem;
  color: #7e4d1a;
  background: #e9dcd3;

}
.money .right{
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  padding: 0 0.2rem;
  font-weight:bold;
  width: 2.5rem;

}
.money .right>div i{
 margin: 0 0.1rem;
}
.money .right>div span{
  padding: 0.05rem;
  color: blue;
  border: 0.01rem solid blue;
  border-radius: 50%;
}
.money .right>div .add{
  background: #333b93;
  color: #fff;
}
</style>